<% html_title "#{@version.name} - " + l(:version_burndown_charts) -%>
<% content_for :header_tags do %>
  <%= javascript_include_tag '/plugin_assets/open_flash_chart/javascripts/swfobject.js' %>
  <%= stylesheet_link_tag 'version_burndown_charts', :plugin => 'redmine_version_burndown_charts' %>
<% end %>

<% unless flash[:error] -%>
  <%= @graph %>
<% end -%>

<% content_for :sidebar do -%>
  <h3><%= l(:version_burndown_charts_version_info) %></h3>
  <div><strong><%=l(:version_burndown_charts_versions_name)%>:<%=link_to(@version.name, :controller => 'versions', :action => 'show', :id => @version.id) %></strong></div>
  <div><%=l(:version_burndown_charts_estimated_hours, :estimated_hours => @estimated_hours)%></div>
  <div><%=l(:version_burndown_charts_spent_hours, :spent_hours => @version.spent_hours)%></div>
  <div><%=l(:version_burndown_charts_issues_count, :issues_count => @version.issues_count)%></div>
  <div><%=l(:version_burndown_charts_open_issues_count, :open_issues_count => @version.open_issues_count)%>(<%=@open_pourcent%>%)</div>
  <div><%=l(:version_burndown_charts_closed_issues_count, :closed_issues_count => @version.closed_issues_count)%>(<%=@closed_pourcent%>%)</div>
  <div><%=l(:version_burndown_charts_start_date, :start_date => @start_date)%></div>
  <div><%=l(:version_burndown_charts_due_date, :due_date => @version.due_date)%></div>
  <div><%=l(:version_burndown_charts_sprint_range, :sprint_range => @sprint_range)%></div>

  <h4><%= l(:version_burndown_charts_versions_open) %></h4>
  <dl>
    <% @open_versions.each do |version| -%>
      <dt<%= %Q[ class="selected"] if @version.id == version.id %>>
        <%= version.effective_date %>
      </dt>
      <dd>
        <%= link_to(version.name, :controller => 'version_burndown_charts', :action => 'index', :project_id => @project.id, :version_id => version.id.to_s) %>
      </dd>
    <% end -%>
  </dl>

  <h4><%= l(:version_burndown_charts_versions_locked) %></h4>
  <dl>
    <% @locked_versions.each do |version| -%>
      <dt<%= %Q[ class="selected"] if @version.id == version.id %>>
        <%= version.effective_date %>
      </dt>
      <dd>
        <%= link_to(version.name, :controller => 'version_burndown_charts', :action => 'index', :project_id => @project.id, :version_id => version.id.to_s) %>
      </dd>
    <% end -%>
  </dl>

  <h4><%= l(:version_burndown_charts_versions_closed) %></h4>
  <dl>
    <% @closed_versions.each do |version| -%>
      <dt<%= %Q[ class="selected"] if @version.id == version.id %>>
        <%= version.effective_date %>
      </dt>
      <dd>
        <%= link_to(version.name, :controller => 'version_burndown_charts', :action => 'index', :project_id => @project.id, :version_id => version.id.to_s) %>
      </dd>
    <% end -%>
  </dl>
<% end -%>
